source /etc/profile
export JAVA_HOME
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export JAVA="$JAVA_HOME/bin/java"
export BASE_DIR=`cd $(dirname $0)/.; pwd`
export DEFAULT_SEARCH_LOCATIONS="classpath:/,classpath:/config/,file:./,file:./config/"
export CUSTOM_SEARCH_LOCATIONS=${DEFAULT_SEARCH_LOCATIONS},file:${BASE_DIR}/conf/

pid=`ps -ef | grep demo-0.0.1-SNAPSHOT.jar | grep -v grep | awk '{print $2}'`
echo  "id:$pid"
if [ -n "$pid" ] 
  then
  kill -9 $pid
fi
echo 1

cd ${BASE_DIR}

nohup $JAVA -Xms400m -Xmx400m -jar demo-0.0.1-SNAPSHOT.jar >> ${BASE_DIR}/log/System1.out 2>&1 &
echo 2


